package org.example.order.domain;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * Description: Order
 * Author: e
 * CreateDate: 2021-08-02
 */
public class Order implements Serializable {
    //订单id
    private long orderId;
    //数量
    private int number;
    //名称
    private String productName;
    //单价价钱
    private double price;
    //下单人
    private long userId;
    //支付状态0 未支付；1 已支付；2 取消订单
    private Integer status;

    //附加内容
    private String addition;
    //订单创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    //订单支付时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    public long getOrderId() {
        return orderId;
    }

    public void setOrderId(long orderId) {
        this.orderId = orderId;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public String getAddition() {
        return addition;
    }

    public void setAddition(String addition) {
        this.addition = addition;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderId=" + orderId +
                ", number=" + number +
                ", productName='" + productName + '\'' +
                ", price=" + price +
                ", userId=" + userId +
                ", status=" + status +
                ", addition='" + addition + '\'' +
                ", createTime=" + createTime +
                ", payTime=" + payTime +
                '}';
    }
}
